package com.fly.test.spring;

import org.springframework.context.support.GenericXmlApplicationContext;

import com.fly.utils.SpringContextUtils;

import lombok.extern.slf4j.Slf4j;

/**
 * 
 * MainRun
 * 
 * @author 00fly
 * @version [版本号, 2018-11-01]
 * @see [相关类/方法]
 * @since [产品/模块版本]
 */
@Slf4j
public class MainRun
{
    /**
     * Spring管理hibernate 演示
     * 
     * @param args
     * @see [类、类#方法、类#成员]
     */
    public static void main(String[] args)
    {
        GenericXmlApplicationContext context = new GenericXmlApplicationContext();
        context.setValidating(false);
        context.load("classpath:application-hbn.xml");
        context.refresh();
        int i = 1;
        for (String beanName : context.getBeanDefinitionNames())
        {
            log.info("{}. {} ---> {}", i, beanName, SpringContextUtils.getBean(beanName));
            i++;
        }
        context.close();
    }
}
